Add Fable 5 support across Anthropic providers#555
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (23)
🚧 Files skipped from review as they are similar to previous changes (19)
📝 WalkthroughWalkthroughThis PR registers Claude Fable 5 across provider registries, adds capability overrides and temperature guards in fetchers and handlers, marks the model as adaptive-thinking where appropriate, enables prompt-caching for Anthropic, wires provider-specific reasoning parameters for Requesty, and adds tests across providers to validate behavior. ChangesClaude Fable 5 Multi-Provider Support
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install timed out. The project may have too many dependencies for the sandbox. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (4)
packages/types/src/providers/bedrock.ts (2)
591-598:⚠️ Potential issue | 🟠 Major | ⚡ Quick winAdd
anthropic.claude-fable-5to the 1M context model list.The
anthropic.claude-fable-5model definition (line 222) declarescontextWindow: 1_000_000, but the model ID is missing from theBEDROCK_1M_CONTEXT_MODEL_IDSconstant. This constant gates extended context behavior (per the inline comment on line 172 referencing the beta flag), so the omission could prevent 1M context requests for Fable 5 on Bedrock.🔧 Proposed fix
export const BEDROCK_1M_CONTEXT_MODEL_IDS = [ "anthropic.claude-sonnet-4-20250514-v1:0", "anthropic.claude-sonnet-4-5-20250929-v1:0", "anthropic.claude-sonnet-4-6", "anthropic.claude-opus-4-6-v1", "anthropic.claude-opus-4-7", "anthropic.claude-opus-4-8", + "anthropic.claude-fable-5", ] as const🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/types/src/providers/bedrock.ts` around lines 591 - 598, The BEDROCK_1M_CONTEXT_MODEL_IDS constant is missing the Anthropic Fable 5 model ID, so add "anthropic.claude-fable-5" to the BEDROCK_1M_CONTEXT_MODEL_IDS array to match the model definition that sets contextWindow: 1_000_000 (see the model definition for Fable 5). Update the array in the BEDROCK_1M_CONTEXT_MODEL_IDS export to include that exact string so Fable 5 is treated as a 1M-context model by the extended-context gating logic.
609-618:⚠️ Potential issue | 🟡 MinorAdd
anthropic.claude-fable-5to global inference allowlistAWS Bedrock’s Claude Fable 5 model card lists the Global inference ID as
global.anthropic.claude-fable-5, butBEDROCK_GLOBAL_INFERENCE_MODEL_IDScurrently omitsanthropic.claude-fable-5, so whenawsUseGlobalInferenceis enabled the provider won’t apply theglobal.prefix for this model. Add"anthropic.claude-fable-5"topackages/types/src/providers/bedrock.ts(lines ~609-618).🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/types/src/providers/bedrock.ts` around lines 609 - 618, BEDROCK_GLOBAL_INFERENCE_MODEL_IDS is missing the entry for Claude Fable 5, so when awsUseGlobalInference is enabled the provider won't add the required "global." prefix; fix it by adding "anthropic.claude-fable-5" to the BEDROCK_GLOBAL_INFERENCE_MODEL_IDS const (the array exported in packages/types/src/providers/bedrock.ts) so the global inference allowlist includes that model ID.packages/types/src/providers/vertex.ts (1)
645-652:⚠️ Potential issue | 🟠 Major | ⚡ Quick winAdd
claude-fable-5to the 1M context model list.The
claude-fable-5model definition (line 439) declarescontextWindow: 1_000_000, but the model ID is missing from theVERTEX_1M_CONTEXT_MODEL_IDSconstant. Per the comment on line 644, this constant gates the beta header'context-1m-2025-08-07'for extended context. Omitting Fable 5 will prevent 1M context requests from working correctly on Vertex.🔧 Proposed fix
export const VERTEX_1M_CONTEXT_MODEL_IDS = [ "claude-sonnet-4@20250514", "claude-sonnet-4-5@20250929", "claude-sonnet-4-6", "claude-opus-4-6", "claude-opus-4-7", "claude-opus-4-8", + "claude-fable-5", ] as const🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/types/src/providers/vertex.ts` around lines 645 - 652, The VERTEX_1M_CONTEXT_MODEL_IDS constant is missing the "claude-fable-5" model ID which prevents the 1M context beta header from being applied; update the VERTEX_1M_CONTEXT_MODEL_IDS array to include "claude-fable-5" (alongside the other entries) so that the model declared with contextWindow: 1_000_000 (the claude-fable-5 definition) is correctly recognized for extended context handling.packages/types/src/providers/openrouter.ts (1)
72-91:⚠️ Potential issue | 🟠 Major | ⚡ Quick winAdd
anthropic/claude-fable-5to the reasoning budget models list.The
claude-fable-5model definition inanthropic.ts(lines 140-141) sets bothsupportsReasoningBudget: trueandsupportsReasoningBinary: true, matching the reasoning capabilities of models already in this set (e.g.,anthropic/claude-opus-4.6,anthropic/claude-sonnet-4.6). Omitting Fable 5 fromOPEN_ROUTER_REASONING_BUDGET_MODELSwill prevent the UI from offering reasoning toggles for this model on the OpenRouter provider path.🔧 Proposed fix
export const OPEN_ROUTER_REASONING_BUDGET_MODELS = new Set([ "anthropic/claude-3.7-sonnet:beta", "anthropic/claude-opus-4", "anthropic/claude-opus-4.1", "anthropic/claude-opus-4.5", "anthropic/claude-opus-4.6", + "anthropic/claude-fable-5", "anthropic/claude-sonnet-4", "anthropic/claude-sonnet-4.5", "anthropic/claude-sonnet-4.6", "anthropic/claude-haiku-4.5",🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/types/src/providers/openrouter.ts` around lines 72 - 91, OPEN_ROUTER_REASONING_BUDGET_MODELS is missing the anthropic Fable 5 entry so the UI won't surface reasoning toggles for that model; add "anthropic/claude-fable-5" to the OPEN_ROUTER_REASONING_BUDGET_MODELS Set (alongside existing entries like "anthropic/claude-opus-4.6") so the provider path recognizes Fable 5's supportsReasoningBudget/supportsReasoningBinary capabilities.
🧹 Nitpick comments (2)
src/api/providers/fetchers/__tests__/openrouter.spec.ts (1)
293-317: ⚡ Quick winExpand test coverage to verify reasoning capabilities.
The test verifies
maxTokens,contextWindow, andsupportsTemperature, but doesn't assertsupportsReasoningBudgetorsupportsReasoningBinary. The similar test forclaude-3.7-sonnet(lines 19-48) includes assertions for reasoning capabilities. Whether these fields should betrue,false, orundefinedfor claude-fable-5, the test should explicitly verify the expected behavior to ensure configuration correctness.🧪 Suggested test expansion
expect(result.maxTokens).toBe(128000) expect(result.contextWindow).toBe(1000000) expect(result.supportsTemperature).toBe(false) + expect(result.supportsReasoningBudget).toBeDefined() + expect(result.supportsReasoningBinary).toBeDefined() })As per coding guidelines: use package-local unit tests for pure logic, parsing, state transitions, validation, serialization, request construction, retry decisions, and error handling.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/api/providers/fetchers/__tests__/openrouter.spec.ts` around lines 293 - 317, The test for claude-fable-5 in openrouter.spec.ts omits assertions for reasoning capability flags; update the test that calls parseOpenRouterModel (id: "anthropic/claude-fable-5") to explicitly assert the expected values for result.supportsReasoningBudget and result.supportsReasoningBinary (match the expected behavior used in the claude-3.7-sonnet test), e.g., add expect(result.supportsReasoningBudget).toBe(...) and expect(result.supportsReasoningBinary).toBe(...) so the parsing logic for reasoning capabilities is covered.Source: Coding guidelines
src/api/transform/model-params.ts (1)
183-190: 💤 Low valueUpdate or remove the outdated TODO comment.
The TODO comment mentions adding a
supportsTemperaturefield to model info and populating it in the OpenRouter fetcher, but this PR actually implements that functionality. The generic guard above (lines 179-181) now honors thesupportsTemperatureflag, and per the context snippet, the OpenRouter fetcher sets this flag forclaude-fable-5.Consider updating the comment to reflect that the field now exists but may need broader adoption across additional models, or remove it if the TODO is fully addressed.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/api/transform/model-params.ts` around lines 183 - 190, The TODO about adding a supportsTemperature field is now outdated—update the comment or remove it: either delete the TODO lines and the note about OpenRouter's supported_parameters, or change the comment to note that supportsTemperature is implemented (used by the generic guard above) and that OpenRouter fetcher already sets it for models like "claude-fable-5"; locate the block handling modelId === "openai/o1-pro" in model-params.ts and adjust the comment accordingly so it accurately reflects the current supportsTemperature handling.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/types/src/providers/anthropic.ts`:
- Around line 129-145: The claude-fable-5 provider entry in
packages/types/src/providers/anthropic.ts currently sets maxTokens: 128_000
while the same model entries in packages/types/src/providers/bedrock.ts and
packages/types/src/providers/vertex.ts use 8192; update the claude-fable-5
declaration to either match 8192 or add explicit logic/documentation that the
128k value is only valid when the reasoning toggle is enabled (e.g., reference
the override comment about `enableReasoningEffort`), and ensure any enforcement
is centralized (same constant or helper) so token limits are consistent across
the "claude-fable-5" entries and any code that reads provider.maxTokens uses the
unified value or the documented conditional.
---
Outside diff comments:
In `@packages/types/src/providers/bedrock.ts`:
- Around line 591-598: The BEDROCK_1M_CONTEXT_MODEL_IDS constant is missing the
Anthropic Fable 5 model ID, so add "anthropic.claude-fable-5" to the
BEDROCK_1M_CONTEXT_MODEL_IDS array to match the model definition that sets
contextWindow: 1_000_000 (see the model definition for Fable 5). Update the
array in the BEDROCK_1M_CONTEXT_MODEL_IDS export to include that exact string so
Fable 5 is treated as a 1M-context model by the extended-context gating logic.
- Around line 609-618: BEDROCK_GLOBAL_INFERENCE_MODEL_IDS is missing the entry
for Claude Fable 5, so when awsUseGlobalInference is enabled the provider won't
add the required "global." prefix; fix it by adding "anthropic.claude-fable-5"
to the BEDROCK_GLOBAL_INFERENCE_MODEL_IDS const (the array exported in
packages/types/src/providers/bedrock.ts) so the global inference allowlist
includes that model ID.
In `@packages/types/src/providers/openrouter.ts`:
- Around line 72-91: OPEN_ROUTER_REASONING_BUDGET_MODELS is missing the
anthropic Fable 5 entry so the UI won't surface reasoning toggles for that
model; add "anthropic/claude-fable-5" to the OPEN_ROUTER_REASONING_BUDGET_MODELS
Set (alongside existing entries like "anthropic/claude-opus-4.6") so the
provider path recognizes Fable 5's
supportsReasoningBudget/supportsReasoningBinary capabilities.
In `@packages/types/src/providers/vertex.ts`:
- Around line 645-652: The VERTEX_1M_CONTEXT_MODEL_IDS constant is missing the
"claude-fable-5" model ID which prevents the 1M context beta header from being
applied; update the VERTEX_1M_CONTEXT_MODEL_IDS array to include
"claude-fable-5" (alongside the other entries) so that the model declared with
contextWindow: 1_000_000 (the claude-fable-5 definition) is correctly recognized
for extended context handling.
---
Nitpick comments:
In `@src/api/providers/fetchers/__tests__/openrouter.spec.ts`:
- Around line 293-317: The test for claude-fable-5 in openrouter.spec.ts omits
assertions for reasoning capability flags; update the test that calls
parseOpenRouterModel (id: "anthropic/claude-fable-5") to explicitly assert the
expected values for result.supportsReasoningBudget and
result.supportsReasoningBinary (match the expected behavior used in the
claude-3.7-sonnet test), e.g., add
expect(result.supportsReasoningBudget).toBe(...) and
expect(result.supportsReasoningBinary).toBe(...) so the parsing logic for
reasoning capabilities is covered.
In `@src/api/transform/model-params.ts`:
- Around line 183-190: The TODO about adding a supportsTemperature field is now
outdated—update the comment or remove it: either delete the TODO lines and the
note about OpenRouter's supported_parameters, or change the comment to note that
supportsTemperature is implemented (used by the generic guard above) and that
OpenRouter fetcher already sets it for models like "claude-fable-5"; locate the
block handling modelId === "openai/o1-pro" in model-params.ts and adjust the
comment accordingly so it accurately reflects the current supportsTemperature
handling.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: d1390678-92d0-463e-8a96-d7c6cc6afd7b
📒 Files selected for processing (22)
packages/types/src/providers/anthropic.tspackages/types/src/providers/bedrock.tspackages/types/src/providers/openrouter.tspackages/types/src/providers/vercel-ai-gateway.tspackages/types/src/providers/vertex.tssrc/api/providers/__tests__/anthropic-vertex.spec.tssrc/api/providers/__tests__/anthropic.spec.tssrc/api/providers/__tests__/bedrock.spec.tssrc/api/providers/__tests__/requesty.spec.tssrc/api/providers/__tests__/vercel-ai-gateway.spec.tssrc/api/providers/anthropic.tssrc/api/providers/bedrock.tssrc/api/providers/fetchers/__tests__/openrouter.spec.tssrc/api/providers/fetchers/__tests__/vercel-ai-gateway.spec.tssrc/api/providers/fetchers/openrouter.tssrc/api/providers/fetchers/requesty.tssrc/api/providers/fetchers/vercel-ai-gateway.tssrc/api/providers/requesty.tssrc/api/providers/vercel-ai-gateway.tssrc/api/transform/__tests__/model-params.spec.tssrc/api/transform/model-params.tssrc/shared/__tests__/api.spec.ts
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Reviewed the Fable 5 registry wiring. A few of the model-info additions don't have the matching allowlist entry, which is where the behavior actually gets gated. Notes inline.
One smaller thing not inline: maxTokens is 8192 on Bedrock/Vertex vs 128k on direct Anthropic. That matches the opus-4-5 pattern in the same files so it's likely intentional, but it does cap long outputs on those paths. Just confirming that's deliberate.
| }, | ||
| ], | ||
| }, | ||
| "anthropic.claude-fable-5": { |
There was a problem hiding this comment.
This entry declares contextWindow 1M, but anthropic.claude-fable-5 isn't in BEDROCK_1M_CONTEXT_MODEL_IDS. Every other Claude model that advertises 1M keeps a 200k base plus a tier that gets unlocked by the context-1m-2025-08-07 beta header, and that header is gated on this list. Fable 5 skips that pattern on all three paths, including direct Anthropic (the beta push in anthropic.ts doesn't list it either). If the model needs the beta header to serve 1M, requests past 200k will fail and the window advertised here is misleading. If Fable 5 serves 1M natively without the header, this is correct as written. Which is it?
There was a problem hiding this comment.
Resolved. Confirmed from the AWS Bedrock console that Fable 5 can only be used through a cross-region inference profile — so the 1M context window is native and the context-1m-2025-08-07 beta header is not needed (correctly omitted from BEDROCK_1M_CONTEXT_MODEL_IDS). Added anthropic.claude-fable-5 to BEDROCK_GLOBAL_INFERENCE_MODEL_IDS since the inference profile is mandatory for this model.
| }, | ||
| ], | ||
| }, | ||
| "claude-fable-5": { |
There was a problem hiding this comment.
Same question as the Bedrock entry: claude-fable-5 declares 1M context but isn't in VERTEX_1M_CONTEXT_MODEL_IDS, so the context-1m-2025-08-07 beta header is never sent on this path. Fine if the model serves 1M without the header, broken if it needs it.
There was a problem hiding this comment.
Resolved. Confirmed that Fable 5 has a native 1M context window on Vertex AI — it does not require the context-1m-2025-08-07 opt-in beta header. Correctly omitted from VERTEX_1M_CONTEXT_MODEL_IDS; the contextWindow: 1_000_000 in the registry entry is accurate as-is.
| "anthropic/claude-opus-4.1", | ||
| "anthropic/claude-opus-4.5", | ||
| "anthropic/claude-opus-4.6", | ||
| "anthropic/claude-fable-5", |
There was a problem hiding this comment.
Fable 5 is in OPEN_ROUTER_PROMPT_CACHING_MODELS but not OPEN_ROUTER_REASONING_BUDGET_MODELS. The fetcher only sets supportsReasoningBudget from that second set, and the fable-5 override block in fetchers/openrouter.ts doesn't set it either, so on OpenRouter the reasoning toggle won't show up even though every other provider path has supportsReasoningBudget: true. The fetcher test only checks maxTokens, contextWindow, and supportsTemperature, so this gap isn't caught.
There was a problem hiding this comment.
Resolved. Added anthropic/claude-fable-5 to OPEN_ROUTER_REASONING_BUDGET_MODELS so supportsReasoningBudget is set on the OpenRouter path. Also added supportsReasoningBinary = true to the Fable 5 override block in fetchers/openrouter.ts to match the other provider paths. The OpenRouter fetcher test now asserts both flags.
| }) | ||
|
|
||
| it("returns true when the id carries a cross-region or global prefix", () => { | ||
| expect(isAdaptiveThinkingModel("us.anthropic.claude-opus-4-8")).toBe(true) |
There was a problem hiding this comment.
This asserts the global. prefix on Fable 5, but anthropic.claude-fable-5 isn't in BEDROCK_GLOBAL_INFERENCE_MODEL_IDS, so getModel() never produces global.anthropic.claude-fable-5 at runtime (the prefix is only applied for ids in that list). The test passes because isAdaptiveThinkingModel matches on substring, but it covers an id that can't occur in production. If Fable 5 should be reachable through global inference, add it to the list.
There was a problem hiding this comment.
Resolved. Added anthropic.claude-fable-5 to BEDROCK_GLOBAL_INFERENCE_MODEL_IDS — confirmed from the AWS Bedrock console that cross-region inference is mandatory for Fable 5 (not optional like the other models in this list). The existing test at this line now covers a real production path, and a new test was added to verify getModel() produces global.anthropic.claude-fable-5 when awsUseGlobalInference: true.
| cacheReadsPrice: parseApiPrice(rawModel.cached_price), | ||
| } | ||
|
|
||
| if (rawModel.id === "anthropic/claude-fable-5") { |
There was a problem hiding this comment.
This override has no direct coverage. The requesty handler tests mock ../fetchers/modelCache with a hardcoded fable-5 entry, so getRequestyModels parsing this branch never runs in the suite. A small test that feeds a raw anthropic/claude-fable-5 model through getRequestyModels and checks these three flags would close that.
There was a problem hiding this comment.
Resolved. Added src/api/providers/fetchers/__tests__/requesty.spec.ts with direct unit tests for getRequestyModels that exercise the Fable 5 override branch (lines 48–52) without mocking the model cache. Covers both that the three flags are applied for anthropic/claude-fable-5 and that they are not applied to other models.
There was a problem hiding this comment.
Re-checked the follow-up commit against the earlier review threads. The gaps are closed:
- OpenRouter:
anthropic/claude-fable-5is inOPEN_ROUTER_REASONING_BUDGET_MODELS, the fetcher override setssupportsReasoningBinary, and the test now asserts both reasoning flags. - Bedrock global inference: model is in
BEDROCK_GLOBAL_INFERENCE_MODEL_IDSwith a test thatgetModel()emitsglobal.anthropic.claude-fable-5when the toggle is on. - Requesty: new
fetchers/__tests__/requesty.spec.tshits the Fable 5 override branch directly. - 1M context on Bedrock/Vertex: omission from the beta-header allowlists is consistent with native 1M, per the thread replies.
- maxTokens split across provider registries matches the existing opus pattern.
Looks good from here.
Summary
Testing
Summary by CodeRabbit
New Features
Tests